package com.manager.cms.config;

import com.github.pagehelper.PageInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

/**
 */
@Configuration
public class PageHelperConfig {

    //配置mybatis的分页插件pageHelper
    @Bean
    public PageInterceptor pageHelper() {
        PageInterceptor pageInterceptor = new PageInterceptor();
        Properties properties = new Properties();
        properties.setProperty("helperDialect", "mysql");    //配置mysql数据库的方言
        pageInterceptor.setProperties(properties);
        return pageInterceptor;
    }
}
